import { showConfirmDialog } from 'vant';
import store from '@/store';
import { ElMessageBox } from 'element-plus'
// 确认框
export default function ({ title, message }) {
    return new Promise((resolve, reject) => {
        if (store.state.isStylePc) {
            ElMessageBox.confirm(message, title, {
                confirmButtonText: '确认',
                cancelButtonText: '取消',
                type: 'warning',
            }
            ).then(() => { resolve(); }).catch(() => { reject() })
        } else {
            showConfirmDialog({
                title,
                message,
            }).then(() => {
                resolve();
            }).catch(() => { reject() });
        }

    })


}